


def query():
    q_name = input("请输入要查询的姓名：")
    print(name_dict[q_name])
    print(q_name,"的年龄是",name_dict[q_name]['age'],"密码是：",name_dict[q_name]['passwd'])

def zhuce():
    name = input("please input your name:")
    age = input("please input your age:")
    passwd = input("please input your passwd:")

    in_dict['age'] = age
    in_dict['passwd'] = passwd
    # print(in_dict)

    name_dict[name] = in_dict
    # print(name_dict)
    print("注册成功！")
name_dict = {}
in_dict = {}
num = input("欢迎进入系统！\n1.注册用户\n2.查询用户\n3.退出\n请选择你想要进行的操作：")

while(int(num) < 4):

    if num == '1':
        zhuce()
        num = input("请选择你想要进行的操作：")
    elif num == '2':
        query()
        num = input("请选择你想要进行的操作：")
    elif num == '3':
        print("退出系统成功！")
        break
    else:
        print("指令无效")
        num = input("请选择你想要进行的操作：")




